package filter

import (
	"net/http"

	"github.com/golang/glog"
)

func GeneralFilter(h http.Handler) http.Handler {
	return logFilter(h)
}

func logFilter(h http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		glog.Infof("request remote addr: %v, uri: %v, method: %v", r.RemoteAddr, r.RequestURI, r.Method)
		h.ServeHTTP(w, r)
	})
}